<template>
  <div class="tabbar">
    <div  :class="{active: currentIndex1 == index }"  @click="handleClickbottom(index)" class="bottom" v-for="(item,index) in bottomArr" :key="index">
        <div class="name">{{item.name}}</div>
    </div>
</div>
</template>

<script>
export default {
    data(){
        return{
            currentIndex1: 0,
            bottomArr:[
                {name:'首页'},
                {name:'订单'},
                {name:'我的'}
            ]
        }
    },
    methods:{
        handleClickbottom(index){
            this.currentIndex1 = index;
        }
    }
}
</script>

<style lang="scss" scoped>
.tabbar{
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 10px;
    border-top: 1px solid #ccc;
    box-sizing: border-box;
    display: flex;
    float: left;
    justify-content: space-around;
    text-align: center;
    line-height: 40px;
}
.tabbar div.active{
    color: blue;
    width: 25%;
    font-size: 20px;
}
</style>